package com.aaa.sas.controller;

import com.aaa.pojo.Pagesas;
import com.aaa.pojo.ResultBeansas;
import com.aaa.pojo.tbl_test_plan_sas;
import com.aaa.sas.service.AccountServicetest;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestParam;
import org.springframework.web.bind.annotation.ResponseBody;

import java.util.Date;

@Controller
@RequestMapping("/accounttest")
@ResponseBody

public class AccountControllerTestsas {
    @Autowired
    AccountServicetest accountServicetest;
    @RequestMapping(value = "/findAlltest"/*, produces = {"application/json;charset=UTF-8"}*/)

    public ResultBeansas findAll(Pagesas pagesas,tbl_test_plan_sas tbl_test_plan_sas) {
        return accountServicetest.findAll(pagesas,tbl_test_plan_sas);
    }
    @RequestMapping("/deletestest")
    public  int deletes(@RequestParam Integer[] id){
        return accountServicetest.deletes(id);

    }
    @RequestMapping("/savetest")


    public  int save(tbl_test_plan_sas tbl_test_plan_sas){
        tbl_test_plan_sas.setTest_code( (int) ((Math.random() * 9 + 1) * 100000));
        tbl_test_plan_sas.setCreate_time(new Date());
        return accountServicetest.save(tbl_test_plan_sas);

    }
    @RequestMapping("/deletetest")


    public  int delete(Integer id){
        return accountServicetest.delete(id);

    }
    @RequestMapping("/updatetest")


    public  int update(tbl_test_plan_sas tbl_test_plan_sas){
        return accountServicetest.update(tbl_test_plan_sas);

    }
}
